import { App } from 'vue'
import {
  ElCol,
  ElRow,
  ElCard,
  ElDivider,
  ElCarousel,
  ElCarouselItem,
  ElLink,
  ElMenu,
  ElMenuItem,
  ElButton,
  ElIcon,
  ElDrawer,
  ElScrollbar,
  ElSlider,
  ElSelect,
  ElOption,
  ElAlert
} from 'element-plus'
import 'element-plus/lib/theme-chalk/base.css'
import {
  ArrowDown,
  ArrowLeftBold,
  ArrowRightBold,
  ArrowUp,
  CaretRight,
  SetUp,
  VideoPause,
  VideoPlay,
  MessageBox
} from '@element-plus/icons'

const components = [
  ElLink,
  ElRow,
  ElCol,
  ElCard,
  ElDivider,
  ElCarousel,
  ElCarouselItem,
  ElMenu,
  ElMenuItem,
  ElButton,
  ElDrawer,
  ElScrollbar,
  ElSlider,
  ElSelect,
  ElOption,
  ElAlert,
  ElIcon,
  ArrowDown,
  ArrowUp,
  VideoPlay,
  VideoPause,
  ArrowLeftBold,
  ArrowRightBold,
  CaretRight,
  SetUp,
  MessageBox
]
/* 引入并注册element组件 */
function registerElement(app: App): void {
  for (const cpn of components) {
    app.component(cpn.name, cpn)
  }
}

export default registerElement
